package com.jm.common.conf.api;

/**
 * 枚举了一些常用API操作码
 *
 * @author kong
 */
public enum ResultCode implements IErrorCode {
    OK(1, "操作成功"),
    FAIL(0, "操作失败"),
    UNAUTHORIZED(-1000, "token已失效");


    /**
     * 状态码
     */
    private final int code;
    /**
     * 消息
     */
    private final String info;
    private String api;

    ResultCode(int code, String info) {
        this.code = code;
        this.info = info;
    }

    ResultCode(int code, String info, String api) {
        this.code = code;
        this.info = info;
        this.api = api;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getInfo() {
        return info;
    }

    @Override
    public String getApi() {
        return api;
    }
}
